package 笔试真题;

import java.util.Scanner;

public class Tengxun4 {
    private static String ans = "";
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        String s = scanner.next();
        traceBack(s,0,k,new StringBuilder());
        System.out.println(ans);

    }

    private static void traceBack(String s, int index, int k, StringBuilder sb) {
        if(k==0){
            String s0 = sb.toString();
            ans = ans.compareTo(s0)>0?ans:s0;
            return;
        }
        if(ans.compareTo(sb.toString())>0) return;
        for (int i = index; i < s.length(); i++) {
            sb.append(s.charAt(i));
            traceBack(s,i+1,k-1,sb);
            sb.delete(sb.length()-1,sb.length());
        }
    }
}
